Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confidential compute s390 #2528

Merged
merged 3 commits into from
Nov 21, 2024
Merged

Confidential compute s390 #2528

merged 3 commits into from
Nov 21, 2024

Conversation

schaefi
Copy link
Collaborator

@schaefi schaefi commented Apr 12, 2024

Added IBM Secure Execution support on s390

IBM SEL(Secure Execution for Linux) is supported for s390 KVM guests. SEL images used to start a confidential computing protected guest contain an encrypted boot image which encapsulates the kernel the initrd and the bootparams. The encrypted Image is provided by the KVM/hypervisor to the Embedded zFirmware of the system (the ultravisor device). The decryption keys are hardware based and each system has an individual keypool unique to that system. The root filesystem is LUKS encrypted with a random key produced by kiwi at build time and kept inside of the initrd which exists only inside of the encrypted boot image and the encrypted rootfs to allow kernel updates. The commit to support secure execution also comes with an integration test that provides profiled image builds to target SUSE's LinuxONE as well as IBM Cloud systems.

@schaefi schaefi self-assigned this Apr 12, 2024
@schaefi
Copy link
Collaborator Author

schaefi commented Apr 12, 2024

To run the integration test for the Virtual-CC build call

sudo qemu-system-s390x -m 4096 --nographic --enable-kvm -drive if=none,id=dr1,file=kiwi-test-image-MicroOS.s390x-16.0.0.qcow2 -device virtio-blk,drive=dr1,bootindex=1

@schaefi
Copy link
Collaborator Author

schaefi commented Apr 12, 2024

@schaefi
Copy link
Collaborator Author

schaefi commented Apr 12, 2024

Tasks to be done

  • Package tooling, genprotimg, does it exist ? yep it's in s390-tools
  • Add a new attribute to the bootloader section for zipl and grub2_s390x_emu hkd_cert, hkd_ca_cert and hkd_sign_cert
  • Add optional attribute hkd_revocation_list
  • Document new attribute values
  • Implement attribute handling for zipl bootloader using an IBM provided binary name referenced by the attribute. This could be genprotimg or another binary but a certain invocation semantic will be implied by kiwi
  • Implement attribute hand over to grub tooling if grub2_s390x_emu is used as bootloader. This needs collaboration with the grub team. There will be GRUB variables to be set in /etc/default/grub
  • Add integration test based on SL-Micro including encryption and CC setup for testing. This needs access to certificates and collaboration with whom ? IBM, SUSE ? both ? is a self signed CA and certs possible for the purpose of testing ?

@Conan-Kudo Conan-Kudo marked this pull request as draft April 21, 2024 13:39
@schaefi schaefi changed the title Confidental compute s390 Confidential compute s390 Jul 23, 2024
@schaefi schaefi force-pushed the confidental_compute_s390 branch 2 times, most recently from 64eb91d to ac37b20 Compare November 6, 2024 15:22
@schaefi schaefi added blocked and removed blocked labels Nov 7, 2024
@schaefi schaefi force-pushed the confidental_compute_s390 branch 3 times, most recently from eab79a7 to 189ab2d Compare November 13, 2024 11:01
@schaefi schaefi marked this pull request as ready for review November 13, 2024 11:03
Copy link
Collaborator

@mfriesenegger mfriesenegger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to find time to discuss the image build process and the first boot of an image.

test/unit/bootloader/config/zipl_test.py Outdated Show resolved Hide resolved
@schaefi schaefi force-pushed the confidental_compute_s390 branch 2 times, most recently from edd31da to 9e418e9 Compare November 15, 2024 13:40
@schaefi schaefi force-pushed the confidental_compute_s390 branch 2 times, most recently from 14696e0 to 084d20f Compare November 18, 2024 09:45
Copy link
Collaborator

@mfriesenegger mfriesenegger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! I hope my suggestions and comments are clear.

Comment on lines 88 to 90
<hkd_cert name="/var/lib/se-certs/HKD-8562-024B858.crt"/>
<hkd_cert name="/var/lib/se-certs/HKD-8562-024B868.crt"/>
<hkd_cert name="/var/lib/se-certs/HKD-8562-024B878.crt"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this should be made generic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I can't follow you, generic ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example

<hkd_cert name="/var/lib/se-certs/HKD-8562-024B878.crt"/>

8562 is the model number of the IBM Z or LinuxONE server.
024B878 is the serial number of the server.

I think keeping the model number is OK but am asking if the serial number should be XXXXXXX, <serial number> or something else.

Copy link
Collaborator Author

@schaefi schaefi Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the files as you see them here comes from packages. I created that packages with the files as I got them from IBM. I think we should not change the filenames in any way, the same applies to the filename of the CA or the revocation lists. The naming from its origin location should just not be touched. I also believe it's not a good idea to interpret the names in any way. We have zero influence here. That '024B878' is a serial number is nice but immaterial :) kiwi doesn't have to work with the certificate names and I don't see where it ever would have the need to do so. Therefore let's focus on the kis principle ... keep it simple, there are certificate files and the only thing we need to know is their location on the build system.

Or am I mistaken ?

@schaefi schaefi force-pushed the confidental_compute_s390 branch 5 times, most recently from becce41 to 22f1cb4 Compare November 20, 2024 17:48
Copy link
Collaborator

@mfriesenegger mfriesenegger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am being picky. Thank you for understanding!

IBM SEL(Secure Execution for Linux) is supported for s390
KVM guests. SEL images used to start a confidential computing
protected guest contain an encrypted boot image which encapsulates
the kernel the initrd and the bootparams. The encrypted Image is
provided by the KVM/hypervisor to the Embedded zFirmware of the
system (the ultravisor device). The decryption keys are hardware
based and each system has an individual keypool unique to that
system. The root filesystem is LUKS encrypted with a random key
produced by kiwi at build time and kept inside of the initrd which
exists only inside of the encrypted boot image and the encrypted
rootfs to allow kernel updates. The commit to support secure
execution also comes with an integration test that provides
profiled image builds to target SUSE's LinuxONE as well
as IBM Cloud systems.
generateDS and other tools are needed and were forgotten
to be added when we deleted the tox dependency
Allow to pass luks="random". In random mode use the
generated keyfile as the only key to decrypt. This is
only secure if the generated initrd also gets protected
e.g. through encryption like it is done with the secure
linux execution on zSystems
Copy link
Collaborator

@mfriesenegger mfriesenegger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all of your work on this!

@schaefi schaefi merged commit 231c3db into main Nov 21, 2024
14 checks passed
@schaefi schaefi deleted the confidental_compute_s390 branch November 21, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants